<template>
  <div class="reward" v-if="!loading">
    <div class="ds">
      <header class="entry-header">
        <h1 class="entry-title text-center">打赏博主</h1>
      </header>
      <div class="post-content">
        <p style="text-align: left;">我们一起来让这个世界有趣一点，听说打赏我的人最后都找到了真爱。听说打赏我的人，都进了福布斯排行榜，打赏的都是天使，打赏了的人都会变美~</p>
        <h2>打赏说明</h2>
        <ul>
          <li>每一笔赞助的70%金额将作为网站运营的费用支出</li>
          <li>每一笔赞助的30%金额将捐给红十字会（金额大于等于20元时）</li>
        </ul>


        <h2>打赏方式</h2>
        <table border="0" align="center" cellpadding="0" cellspacing="0">

          <tr>
            <td valign="top"><img class="wp-image-181 aligncenter" src="../../assets/webzfb.png" alt=""></td>
            <td valign="top"><img class="wp-image-183 aligncenter" src="../../assets/webwx.png" alt=""></td>
          </tr>
          <tr>
            <td><img class="wp-image-183 aligncenter" src="../../assets/webzfb.jpg" alt=""></td>
            <td><img class="wp-image-183 aligncenter" src="../../assets/webwx.jpg" alt=""></td>
          </tr>
        </table>
      </div>
    </div>
    <h2>获取教程</h2>
    <p class="time">网盘地址：<span>{{video.link}}</span></p>
    <p class="time">网盘密码：<span>{{video.password}}</span></p>
    <h2>联系博主</h2>
    <div class="linkmore">
      <ul>
        <li><a href="https://shop279575310.taobao.com" target="_blank" class="iconfont icon-taobao"
               title="淘宝店铺"></a></li>
        <li><a href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&amp;email=2532540336@qq.com"
               target="_blank" class="iconfont icon-email" title="我的邮箱"></a></li>
        <li><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=2532540336&amp;site=qq&amp;menu=yes" target="_blank"
               class="iconfont icon-QQ" title="QQ联系我"></a></li>
        <li class="weixin" @mouseenter="enter" @mouseleave="leave"><a class="iconfont icon-iconwx"
                                                                      title="关注我的微信"></a>
          <i v-show="seen"><img src="../../assets/wx.jpg"></i>
        </li>
      </ul>
    </div>
  </div>
  <!--百度网盘地址-->

  <div v-else-if="!err">
    加载中。。。
  </div>
  <div v-else>
    <img src="../../../static/image/bd.gif"/>
    <div>404</div>
  </div>
</template>

<script>
  import blogHead from "../header/head"
  import blogRight from "../right/right"
  import blogBottom from "../bottom/bottom"
  import {parseTime} from '@/util/date'

  export default {
    components: {
      blogHead,
      blogRight,
      blogBottom,
    },
    data() {
      return {
        video: undefined,
        loading: true,
        err: false,
        previous: null,
        next: null,
        tags: [],
        transition: false,
        seen:false
      }
    },
    computed: {
      route: function () {
        return this.$route.params.code
      }
    },
    methods: {
      init() {
        let code = this.$route.params.id
        this.$http.get(`/api/resource/getDetail/${code}`).then(resp => {
          let data = resp.data.data;
          console.log(data);
          if (data == null) {
            this.video = null;
            this.loading = true;
            this.err = true;
            return;
          }
          this.video = data;
          this.loading = false;
          this.transition = true;
        }).catch(res => {

        });
      },
      index: function () {
        this.$router.push('/');
      },
      enter: function () {
        this.seen = true;

      },
      leave: function () {
        this.seen = false;

      },
      dateFilter(t) {
        if (t) {
          return parseTime(t)
        } else {
          return '未知'
        }
      }
    },
    mounted() {
      this.init();
      window.scrollTo(0, 60);
    },
    watch: {
      $route: {
        handler: function (val, oldVal) {
          this.init();
          window.scrollTo(0, 60);
        },
      }
    }
  }
</script>

<style scoped>
  .reward {
    background: #fff;
    margin-top: 10px;
  }

  .entry-header {
    margin-bottom: 0;
  }

  .entry-title {
    margin: 0 0 15px;
    font-size: 30px;
  }

  .post-content {
    margin: 10px 10px;
    word-break: break-all;
    word-wrap: break-word;
  }

  .post-content p {
    font-size: 16px;
    color: #333;
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;

  }
  h3 {
    font-size: 28px;
    color: #333;
    font-weight: normal;
    padding-top: 30px;
  }


  h2 {
    margin: 15px -25px;
    padding: 0 25px;
    border-left: 5px solid #51aded;
    background-color: #f7f7f7;
    font-size: 18px;
    line-height: 40px;
  }
  p.time {
    font-size: 14px;
    color: #999;
  }

  p.time span {
    color: #f4645f;
  }

  p.time span:hover {
    text-decoration: underline;
    cursor: pointer;
  }


  .post-content table {
    border-collapse: separate;
    border-spacing: 100px 0;
  }

  .post-content table img {
    width: 100%;
  }

  ul {
    display: block;
    list-style-type: disc;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    padding-inline-start: 40px;
  }

  .linkmore {
    margin: 15px;
  }

  .linkmore ul li {
    list-style: none;
    width: 25%;
    float: left;
  }

  .linkmore ul li a {
    height: 45px;
    display: block;
    overflow: hidden;
    box-shadow: 0px 1px 0px rgba(255, 255, 255, .1), inset 0px 1px 1px rgba(0, 0, 0, .7);
    border-radius: 50%;
    margin: 0 5px;
  }


  .weixin {
    position: relative
  }

  .weixin i {
    display: block;
    position: absolute;
    bottom: 30px;
    right: 30px;
  }

  .weixin i img {
    width: 150px;
    height: 150px;
  }

  @media screen and (max-width: 768px) {

    .ds {
      display: none;
    }

    .linkmore {
      margin: 1px;
    }

    .linkmore ul li {
      list-style: none;
      width: 24.5%;
      float: left;
    }

    .linkmore ul li a {
      height: 45px;
      display: block;
      overflow: hidden;
      box-shadow: 0px 1px 0px rgba(255, 255, 255, .1), inset 0px 1px 1px rgba(0, 0, 0, .7);
      border-radius: 50%;
      margin: 0 5px;
    }

    .weixin {
      position: relative
    }

    .weixin i {
      display: block;
      position: absolute;
      bottom: 80px;
      right: 40px;
    }

    .weixin i img {
      width: 150px;
      height: 150px;
    }

  }


</style>

